﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Name="WebService"
xmlns="http://schemas.microsoft.com/pag/gax-core"
Bound="false">
  <DocumentationLinks>
    <Link Url="http://msdn.microsoft.com/en-us/library/ms464040.aspx" Caption="MSDN: Walkthrough: Creating a Custom Web Service" Kind="NextStep" />
  </DocumentationLinks>
  <xi:include href="../../../TypeAlias.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
  <Caption>ASMX Webservice</Caption>
  <Description>Adds a ASP.NET web service</Description>
  <HostData Priority="100">
    <Icon File="Help/Icons/icon_ASPNET.ico" />
    <CommandBar Menu="SPSFProjectASPNET"/>
    <CommandBar Menu="SPSFFolderASPNET"/>
    <spsf:MetaData
      Visible="true"
      BindingType="CustomizationReference"
      BindingTypeTemplate="CustomizationReferenceTemplate"
      TestType="BaseCustomizationRecipeRunner"
      Enabled="true"
      CreateVSTemplate="true"
	  NotSandboxSupported="true"
      Category="ASPNET" xmlns:spsf="http://www.spalmblogger.de">
      <spsf:Authors>
        <spsf:Author>Torsten Mandelkow</spsf:Author>
      </spsf:Authors>
      <spsf:VersionHistory>
        <spsf:VersionHistoryEntry>1.0 Initial Recipe</spsf:VersionHistoryEntry>
      </spsf:VersionHistory>
      <spsf:WebPageContent>
        <![CDATA[]]>
      </spsf:WebPageContent>
		<spsf:Test>
			<spsf:TestCases>
				<spsf:TestCase Name="DefaultWebService" Type="SolutionTestCase">
					<spsf:TestCaseArguments>
						<spsf:TestCaseArgument Name="WebServiceName">WebService</spsf:TestCaseArgument>
						<spsf:TestCaseArgument Name="WebServiceDescription">Description of WebService</spsf:TestCaseArgument>
					</spsf:TestCaseArguments>
					<spsf:TestExpectedDeployResults>
						<spsf:TestExpectedDeployResult Type="ManualCheck">Webservice exists in site /_vti_adm/SolutionName/WebService.asmx</spsf:TestExpectedDeployResult>
					</spsf:TestExpectedDeployResults>
				</spsf:TestCase>
			</spsf:TestCases>
		</spsf:Test>
    </spsf:MetaData>
  </HostData>
  <Arguments>

    <xi:include href="../../BaseArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <Argument Name="WebServiceName">
      <Converter Type="NamespaceStringConverter" />
      <ValueProvider Type="VisualStudioCreateItemName" DefaultValue="Webservice1" />
    </Argument>
    <Argument Name="WebServiceDescription">
      <ValueProvider Type="Evaluator" Expression="Description of WebService1" />
    </Argument>

    <Argument Name="Reference1">
      <ValueProvider Type="Evaluator" Expression="System.Web.Services" />
    </Argument>

  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Height="350">
          <Title>Web Service Settings</Title>
          <Fields>
            <Field Label="Branding" ValueName="SPSFBranding" PanelType="SPALM.SharePointSoftwareFactory.Library.BrandingPanel, SPALM.SharePointSoftwareFactory.Library" />
            <Field ValueName="WebServiceName" Label="Name">
              <Help>Required String. Enter the name of the web service.</Help>
            </Field>
            <Field ValueName="WebServiceDescription" Label="Description">
              <Help>Required String. Enter the description of the web service.</Help>
            </Field>
          </Fields>
        </Page>
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="ConditionalCoordinator">

    <xi:include href="../../BaseStartingActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <Action
		  Name="AddASMX"
		  Type="AddSPDataTemplateAction"
      SPDataName="$(WebServiceName)"
      SPDataCategory="WebServices"
      SPDataTemplate="Text\GenericSPData\SharePointProjectItem.spdata.t4"
		  TemplateFileName="Text\WebService\webservice.asmx.t4"
      TargetFileName="$(WebServiceName).asmx"
      DeploymentType="RootFile"
      DeploymentPath="ISAPI\$(SafeAppName)"
		  Open="true">
      <Output Name="CreatedProjectItem" />
      <Output Name="CreatedProjectFolder" />
    </Action>
 
    <Action
      Name="AddCode"
      Type="AddTemplateToItemAction"
      Open="true"
      TemplateFileName="Text\WebService\webservice.cs.t4"
      TargetFileName="$(WebServiceName).cs">
      <Input Name="ParentProjectItem" ActionOutput="AddASMX.CreatedProjectItem" />
    </Action>

    <Action Name="AddReference1" Type="AddReferenceAction">
      <Input Name="ReferenceName" RecipeArgument="Reference1" />
      <Input Name="ReferringProject" RecipeArgument="CurrentProject" />
    </Action>

    <xi:include href="../../BaseFinalActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

  </Actions>
</Recipe>